﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CarShop
{
    public class Minibus : Vehicle, IDescriptive
    {
        //fields
        private Engine miniEngine;
        private Transmission miniTransmission;
        private byte possiblePassengers;
        private int weight;
        private DrivingWheel drive;
        private List<string> minibusDescription = new List<string>();

        //constructor
        public Minibus(string brand, string model, string color, int year, int speed, int price, Engine minibusEngine, Transmission minibusTransmission, byte possiblePassengers, int weight, DrivingWheel drive)
            : base(brand, model, color, year, speed, price)
        {
            this.miniEngine = minibusEngine;
            this.miniTransmission = minibusTransmission;
            this.possiblePassengers = possiblePassengers;
            this.weight = weight;
            this.drive = drive;
        }

        public Minibus(string brand, string model, string color, int year, int speed, int price, Engine minibusEngine, Transmission minibusTransmission, byte possiblePassengers, int weight, List<string> miniDescription, DrivingWheel drive)
            : this(brand, model, color, year, speed, price, minibusEngine, minibusTransmission, possiblePassengers, weight, drive)
        {
            this.minibusDescription = new List<string>();
        }


        //properties
        public Transmission MiniTransmission
        {
            get
            {
                return this.miniTransmission;
            }
            set
            {
                this.miniTransmission = value;
            }
        }

        public Engine MiniEngine
        {
            get
            {
                return this.miniEngine;
            }
            set
            {
                this.miniEngine = value;
            }
        }

        public byte PossiblePassengers
        {
            get
            {
                return this.possiblePassengers;
            }
            set
            {
                this.possiblePassengers = value;
            }
        }

        private int MiniWeight
        {
            get
            {
                return this.weight;
            }
            set
            {
                this.weight = value;
            }
        }

        private DrivingWheel Drive
        {
            get
            {
                return this.drive;
            }
            set
            {
                this.drive = value;
            }
        }

        public List<string> Description
        {
            get { return minibusDescription; }
            set
            {
                this.minibusDescription = value;
            }
        }

        //methods
        public void AddComment(string extra)
        {
            this.minibusDescription.Add(extra);
        }

        public override string AdditionalInfo()
        {
            StringBuilder someMinibus = new StringBuilder();
            someMinibus.AppendLine("Possible number of passengers: " + this.PossiblePassengers.ToString());
            someMinibus.AppendLine("Bus weight : " + this.MiniWeight.ToString());
            someMinibus.AppendLine("Transmission: " + this.MiniTransmission.ToString());
            someMinibus.AppendLine("Drive: " + this.Drive.ToString());
            someMinibus.AppendLine(this.MiniEngine.ToString());
            someMinibus.AppendLine("Extras :");
            foreach (var extra in minibusDescription)
            {
                someMinibus.Append(extra.ToString() + " ");
            }
            return someMinibus.ToString();
        }

    }
}
